//2009/08/26 16:17:27
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class FloorLayout
{
public:
    int countBoards(vector <string> layout)
    {
        int N = layout.size();
        int M = layout[0].size();
        vector<string> v;
        string s(M+1, '*');
        v.push_back(s);
        for (int i=0; i<N; i++)
        {
            string s1;
            s1 += '*';
            s1 += layout[i];
            v.push_back(s1);
        }
        int ret = 0;
        for (int i=1; i<v.size(); i++)
        {
            for (int j=1; j<v[i].size(); j++)
                if ((v[i-1][j]==v[i][j] && v[i][j] == '|') || (v[i][j-1]==v[i][j]) && v[i][j]=='-' ) continue;
                else ret++;
        }
        return ret;
    }
};
